<#if !basePath??><#assign basePath=request.contextPath ></#if>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>NEBULA-UPMS网站管理平台</title>
	<#include "${basePath}/comm/meta-base.ftl" />
	<#include "${basePath}/comm/meta-easyui.ftl" />
	<#include "${basePath}/comm/meta-comm.ftl" />
	
	<script type="text/javascript" src="${Application.STATIC_SERVER}/project/erp-static/js/md5.js"></script>
	<link href="${Application.STATIC_SERVER}/project/erp-static/css/login.css" rel="stylesheet" type="text/css" />
</head>

<body style="background:#333">

<!--网站顶部菜单 -->

<div class="w hb_header" >
    <div class="hbtitle">NEBULA-UPMS综合管理平台<#if isalert==true ><span style="color:red;font-size:22px;">(${systemName})</span></#if></div>
</div>
<!--//网站顶部菜单 -->

<!--主体 -->
<section class="hb_main">
	<section class="w">
    	<div class="login_news">
        	
        </div>
        <div class="login_form ">
              <form id="login_form" class="" role="form"   method="post" >
              	  <div class="form_title">
                  		用户登录
                  </div>
                  <div class="error-msg error">
                  	<#if error?? && error!="">
                  		登录超时，请重新登录！
                  	</#if>
                  </div>
                  
				  <div class="input-group ">
                    <span class="input-group-addon"><i class="fa fa-user darkorange"></i></span>
                    <input  name="loginName" id="loginName"  type="text" class="form-control logintext" 
                    	 placeholder="登录名" />
                  </div>
                  <div class="input-group margin-top-30 margin-bottom-30 ">
                    <span class="input-group-addon"><i class="fa fa-lock darkorange"></i></span>
                    <input  id="loginPassword" type="password" class="form-control logintext" 
                     placeholder="密码" />
                     <input type="hidden" id="md5Password" name="loginPassword"  />
                  </div>
                  <button type="button" onClick="login()" 
                  	class="btn btn-primary btn-lg btn-block">立即登录</button>
                  <div class="login_tool">
                  </div>
                 
               </form>
        </div>
    </section>
</section>
<!--//主体 -->

<!--底部 -->
<footer class="hb_bottom">
	<section  class="w">
        <div class="contact">
        </div>
        <nav class="b_nav">
          	<div class="dis">Copyright©2004-2016  NEBULA-UPMS.com 版权所有</div>
        </nav>
    </section>
</footer>
<!--//底部 -->

   
</body>
</html>

<script>

$("#loginName").focus();

$('body').keydown(function(e){
	if(e.keyCode==13){
	   login();
	}
});



function login(){
	var loginName=$("#loginName").val();
	var password=$("#loginPassword").val();
	var reg = /\S/;
	if(reg.test(loginName)&&reg.test(password)){
	
		var md5Password=hex_md5(password);
		$("#md5Password").attr("value",md5Password);
		
		$("#login_form").form('submit', {
			url : '${basePath}/loginin',
			dataType : 'text',
			success : function(data) {
				if(data=='success'){
	    			window.location.href="${basePath}/index";
	    		}else{
	    			$(".error-msg").html("账户名与密码不匹配，请重新输入!");
	    			$(".input-group").addClass("has-error");
	    			$("#loginName").focus();
	    		}
			}
		});
	}else{
		$(".error-msg").html("账户名与密码不能为空，请重新输入!");
		$(".input-group").addClass("has-error");
		$("#loginName").focus();
	}

	
	
}

</script>


